package com.example.idie.bean;

public class Response<E> {
    private Integer code;
    private String msg;
    private E body;

    public Response(Integer code, String msg, E body) {
        this.code = code;
        this.msg = msg;
        this.body = body;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public E getBody() {
        return body;
    }

    public void setBody(E body) {
        this.body = body;
    }

    public static <E>Response<E> success(E body){
        return new Response(1000, "", body);
    }

    public static <E>Response<E> fail(Integer code,String msg){
        return new Response(code, msg, (Object) null);
    }
}
